<template>
  <div class="yaoRegister">
    <van-nav-bar
      title="好一招是注册"
      left-text="返回"
      right-text="登录"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
    <img
      src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg2.tapimg.com%2Fbbcode%2Fimages%2F099f895750a4285defe3a0d1bd4d1403.png&refer=http%3A%2F%2Fimg2.tapimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1654418122&t=fa0d93a0e8f3b21304dafb88dbd15176"
      alt=""
      style="width: 100%"
    />
    <van-form @submit="onSubmit" class="form">
      <van-field
        v-model="username"
        name="username"
        label="用户名"
        placeholder="选一个你喜欢的用户名"
        :rules="[{ required: true, message: '请填写用户名' }]"
      />
      <van-field
        v-model="password"
        type="password"
        name="password"
        label="密码"
        placeholder="请输入你要设置的密码"
        :rules="[{ required: true, message: '请填写密码' }]"
      />
      <div style="margin: 16px">
        <van-button round block type="info" native-type="submit">提交</van-button>
      </div>
    </van-form>
  </div>
</template>
<script>
export default {
  data() {
    return { username: "", password: "" };
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    onClickRight() {
      this.$router.push("/login");
    },
    onSubmit(values) {
      console.log("submit", values);
      
    },
  },
};
</script>
<style lang="scss" scoped></style>
